Skip to content

Fix verificationToken bug - #2440

Merged
loay merged 1 commit into
masterfrom
issue414_token2
Jun 17, 2016
Merged

Fix verificationToken bug#2440
loay merged 1 commit into
masterfrom
issue414_token2

Conversation

@loay

@loay loay commented Jun 16, 2016

Copy link
Copy Markdown
Contributor

connect to #414

@loay loay added the #review label Jun 16, 2016
@loay loay mentioned this pull request Jun 16, 2016
@loay

loay commented Jun 16, 2016

Copy link
Copy Markdown
Contributor Author

@bajtos PTAL

@davidcheung

Copy link
Copy Markdown
Contributor

would also fix #2424

Comment thread test/user.test.js
}, done);
});

it('Should report 302 when redirect url is set', function(done) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are calling done twice, see L1440. More importantly, this test passes even when common/models/user.json is not fixed.

Never trust a test you haven't seen fail.

When I added console logs around done() calls, only the second done on L1440 was called. The event handler for confirmed even is never triggered. I think that's because you are adding the listener long time after confirm() method was invoked.

I am proposing to simplify this test and call User.confirm directly - the behaviour you are fixing is independent of the way how the method is invoked (from code or via REST API).

As I was playing with the test code to make it work correctly, I figured out I can as well commit my changes - see fc90538. This fixup commit should be rebased away before merging the PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line comment is misplaced because I submitted after pushing the fixup commit. Sorry for the confusion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird. I tested when it was set to undefined and it failed .. It must have been something else.
Anyways, your changes LGTM. I tested with undefined and it failed then it passed with null.
Thanks.

@bajtos

bajtos commented Jun 17, 2016

Copy link
Copy Markdown
Member

@loay I added a commit fixing the test, PTAL. If my changes LGTY and CI builds passes, then you can go ahead, squash commits and land the fix.

Please back-port this fix to 2.x, don't forget to include a reference to this PR in the commit message in 2.x.

@bajtos bajtos assigned loay and unassigned bajtos Jun 17, 2016
@loay
loay force-pushed the issue414_token2 branch from fc90538 to f0a796d Compare June 17, 2016 14:15
@loay
loay force-pushed the issue414_token2 branch from f0a796d to ec51e83 Compare June 17, 2016 14:22
@loay
loay merged commit 45e523d into master Jun 17, 2016
@loay loay removed the #review label Jun 17, 2016
loay added a commit that referenced this pull request Jun 17, 2016
@loay
loay deleted the issue414_token2 branch June 17, 2016 15:21
bajtos added a commit that referenced this pull request Jul 12, 2016
 * Fix description for User.prototype.hasPassword (Jue Hou)
 * Fix verificationToken bug #2440 (Loay)
 * add missing unit tests for #2108 (Benjamin Kroeger)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants